package com.salmon.boot.activiti.controller;


import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {

    @Autowired
    private RuntimeService runtimeService;

    @GetMapping("/test")
    public String test(){
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("second_approve");
        log.info(processInstance.getName());
        return "hello";
    }
}
